<extend name="Base/common"/>

<block name="style">
<link href="__CSS__/stylesheet.css" rel="stylesheet">
<link href="__CSS__/product_stylesheet.css" rel="stylesheet">
</block>

<block name="script">
<link href="__STATIC__/jqzoom/css/jqzoom.css" rel="stylesheet">
<script type="text/javascript" src="__STATIC__/jqzoom/js/jquery.jqzoom.js"></script>
<script type="text/javascript" src="__JS__/product.js"></script>
<script type="text/javascript">
$(function(){
	$('nav .tools li').eq(0).remove();
	
	$('.sub-menu').hover(function(){
		$(this).find('ul').removeClass('hidden');
	}, function(){
		$(this).find('ul').addClass('hidden');
	});
});
</script>
</block>

<block name="header">
<header>
	<div class="container">
		<section class="menu-top">
			<div class="fl">
				<section class="header-logo-search">
					<div class="logo fl">
						<img src="__IMG__/logo.png"/>
					</div>
					<div class="search form-group fl">
						<form action="" method="post" autocomplete="off">
							<div class="dropdown fl">
								<a data-toggle="dropdown" href="javascript:;">商品</a>
								<ul class="dropdown-menu">
									<li><a href="javascript:;" data-id="putong">商品</a></li>
									<li><a href="javascript:;" data-id="paipin">拍品</a></li>
									<li><a href="javascript:;" data-id="xianzhi">闲置</a></li>
								</ul>
							</div>
							<input name="type" type="hidden" value="putong">
							<input name="title" type="text" class="search-text" />
							<a href="javascript:;" class="search-btn fr">搜 索</a>
							<script type="text/javascript">
							$(function(){
								$('.dropdown li a').click(function(){
									self = $(this), type = $('.search input[name="type"]');
									$('.dropdown > a').text(self.text());
									type.val(self.attr('data-id'));
								});
							});
							</script>
						</form>
					</div>
				</section>
				<section class="header-ad">
					<img src="__IMG__/header_ad.png">
				</section>
			</div>
	        <div class="fr qrecode">
	            <img src="__IMG__/QRcode.png"/>
	        </div>
        </section>
        <div class="sub-menu fl">
			<a class="sub-menu-top" href="{:U('Product/Index')}">全部商品分类</a>
			<ul class="hidden">
				<volist name=":getCategoryTree()" id='vo'>
					<li>
						<a  class="title" href="{:U('Product/Index?fid='.$vo['id'])}">{$vo.title}</a>
						<div class="sub-menu-list">
							<volist name="vo._child" id="child">
								 <a href="{:U('Product/Index?cid='.$child['id'])}">{$child.title}</a>
					 		</volist>
						</div>
					</li>
				</volist>	
			</ul>
		</div>
		<div class="sub-nav">
	       	<ul>
	       		<li><a href="{:U('Index/index')}">首页</a></li>
	       		<li><a href="{:U('Identify/index')}">鉴真宝</a></li>
	       		<li><a href="{:U('Pzb/index')}">拍真宝</a></li>
	       		<li><a href="{:U('Qgh/index')}">抢购会</a></li>
	       		<li><a href="{:U('Pzg/index')}">拍照购</a></li>
	       		<li><a href="{:U('Xlw/index')}">选礼物</a></li>
	       		<li><a href="{:U('Xz/index')}">闲置</a></li>
	       	</ul>
	    </div>
	</div>
</header>
</block>

<block name="body">
<div class="container main">
	<div class="col-xs-9" style="background-color: #ffffff;">
		<div class="row">
			<ul class="breadcrumb" style="background-color: #f5f5f5;">
				<li>当前位置</li>
				<li><a href="{:U('index')}">首页</a></li>
				<li><a href="{:U('product',array('cid'=>$info['category_id']))}">{$info.category_title}</a></li>
				<li>商品详情</li>
			</ul>
				<div class="product-description">
					<div class="product-img">
						<div class="product-img-curr jqzoom">
							<notempty name="info['images']">
							<volist name="info['images']" id='vo' offset="0" length="1">
							<img src="{$vo.path}" jqimg="{$vo.path}" />
							</volist>
							<else/>
							<img src="">
							</notempty>
						</div>
						<ul class="product-img-thumbs">	
							<volist name="info['images']" id='vo' key="key">
							<li <eq name='key' value='1'>class="selected" </eq>>
								<a href="javascript:;"><img src="{$vo.path}" /></a></li>
							</volist>
						</ul>
					</div>
					<div class="product-info">
						<div class="product-info-hd">
							<h1>{$info.title}</h1>
						</div>
						<div class="product-info-panel">
							<dl class="product-info-panel-price">
								<dt>原价：</dt>
								<dd>
									<em class="yen">￥</em>
									<span class="price">{$info.price}元</span>
								</dd>
							</dl>
							<dl class="product-info-panel-promo">
								<dt>现价：</dt>
								<dd>
									<em class="yen">￥</em>
									<span class="price">{$info.price}元</span>
								</dd>
							</dl>
							<dl class="product-info-panel-stock">
								<dt>库存：</dt>
								<dd>{$info.quantity}</dd>
							</dl>
							<dl class="product-info-panel-quantity">
								<dt>数量：</dt>
								<dd>
									<span class="number-group-addon" onclick="changequantity('-')">-</span>
									<input type="text" class="input-mini" autocomplete="off" id="quantity" value="1">
									<span class="number-group-addon" onclick="changequantity('+')">+</span>
								</dd>
							</dl>
						</div>
						<div class="product-info-action">
						  <form action="{:U('order/addCart')}" method='post'>
								<input type="hidden" name="product_id" value="{$info.id}" />
								<input type="hidden" name="quantity"  value="1"/>
								<a  class="btn cart" href="javascript:;" >加入购物车</a>
							</form>
							
							 <form action="{:U('order/submitorder')}" method='post'>
							 	<input type="hidden" name="quantity"  value="1"/>
								<input type="hidden" name="product_id" value="{$info.id}" />
								<button type="submit" class="btn buy" >立即购买</button>
							</form>
							
							<!-- 
							<form id="formaddcart"  method='post'>
							<a class="btn cart" href="javascript:;" 
							 data-bind="{$info.id}" data-bind="{$info.id}" data-url="{:U('order/addCart')}">加入购物车</a>
							 </form>
							 
							<a class="btn buy" href="javascript:;" data-bind="{$info.id}">立即购买</a>
							 -->
						</div>
						<div class="product-info-service">
							<ul>
								<li><img src="__IMG__/icon1.gif"></li>
								<li><img src="__IMG__/icon2.gif"></li>
								<li><img src="__IMG__/icon3.gif"></li>
								<li><img src="__IMG__/icon4.gif"></li>
							</ul>
						</div>
					</div>
				</div>			
			<ul class="tab-bar">
				<li><a href="#description" class="selected">商品描述</a></li>
				<li><a href="#comment">评价<em>({$info.comment_total})</em></a></li>
			</ul>
			<div class="tab-panel active" id="description">
				{$info.description}
			</div>
			<div class="tab-panel" id="comment">
				<ul class="comment_level">
					<li><label class="radio"><input type="radio" name="comment_level" checked="checked" value="1"><span>好评<em>({$info.comment_rate1})</em></span></label></li>
					<li><label class="radio"><input type="radio" name="comment_level" value="2"><span>中评<em>({$info.comment_rate2})</em></span></label></li>
					<li><label class="radio"><input type="radio" name="comment_level" value="3"><span>差评<em>({$info.comment_rate3})</em></span></label></li>
				</ul>
				<div class="comments">
					<div class="hd">
						<span>评论心得</span>
						<span>评论人</span>
						<span>评论时间</span>
					</div>
					<ul class="bd">
						<li>
							<div class="info">
								<span>宝贝与产品描述相符，卖家服务态度较好，给5分</span>
								<span>项***环</span>
								<span>2015-10-12 10:45</span>
							</div>
							<ul class="img">
								<li><a href="javascript:;" class="popimg"><img src="__IMG__/product/thumb-img.png"></a></li>
								<li><a href="javascript:;" class="popimg"><img src="__IMG__/product/thumb-img.png"></a></li>
								<li><a href="javascript:;" class="popimg"><img src="__IMG__/product/thumb-img.png"></a></li>
							</ul>
						</li>					
					</ul>
					<div class="page center"  data-url="{:U('Product/getComments',array('product_id'=>$info['id']))}"></div>
				</div>
			</div>
		</div>
	</div>
	<div class="col-xs-3 hot">
		<h5>热销产品</h5>
		<volist name="salestop" id="vo">				
			<div class="form-group auto-overflow">
				<a href="{:U('Product/detail',array('id'=>$vo['id']))}"><img src="{$vo.image}" /></a>
				<div class="fl info">
					<div class="title"><a href="{:U('Product/detail',array('id'=>$vo['id']))}">{$vo.title}</a></div>
					<div class="desc">
						<span class="price">￥{$vo.price}.00</span>
						<span class="sale fr">销量：{$vo.sales}</span>
					</div>
				</div>
			</div>
		</volist>
	</div>
</div>
</block>